import link from "@/api/link.js"
let card = {
    state: {
        //轮播图地址
        imgurl: {},
        iconobj: []
    },
    getters: {},
    mutations: {
        //处理轮播图数据
        UPSLIDESHOW(state, payload) {
            state.imgurl = payload.data
        },
        UP_DATA(state, payload) {
            state.iconobj = payload.data.icon
        }
    },
    actions: {
        // HomeBody里的轮播图请求
        SLIDESHOW(context) {
            link("/user/wkc/slideshow", "get").then((ok) => {

                context.commit("UPSLIDESHOW", { data: ok.data })
            })
        },
        //请求twodata的数据
        GET_DATA(context) {
            link("/user/wkc/twodata", "get").then((ok) => {

                context.commit("UP_DATA", { data: ok.data })
            })
        }
    },
}
export default card